package com.atguigu.gulimall.product.web;

import com.atguigu.common.utils.R;
import com.atguigu.gulimall.product.service.SkuInfoService;
import com.atguigu.gulimall.product.vo.SkuItemVO.SkuItemVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ExecutionException;

@RestController
public class itemController {

    @Autowired
    private SkuInfoService skuInfoService;

    @GetMapping("/skuItem/{skuId}")
    public R skuItem(@PathVariable("skuId") Long skuId) throws ExecutionException, InterruptedException {
        SkuItemVo vo = skuInfoService.item(skuId);
        return R.ok().put("data",vo);
    }
}
